<?xml version="1.0" encoding="utf-8"?>

<!--  ==========================================================================================  -->
<!--  ==  GOOGLE MAPS v3 - EW Google Map using Asynchronous API  ===============================  -->
<!--  ==  http://code.google.com/apis/maps/documentation/javascript/  ==========================  -->
<!--  ==========================================================================================  -->

<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Module</cContentSchemaName>
        <cContentXmlBrief>
          <!-- v3 refers to the version of the GoogleMaps API -->
          <Content position="" moduleType="GoogleMapv3" box="" title="" link="" linkType="internal" >
            <Zoom allow="true" disableMouseWheel="false">8</Zoom>
            <Control>Large</Control>
            <View>ROADMAP</View>
            <TypeButtons>true</TypeButtons>
            <Location loc="address" map="" marker="true">
              <Venue/>
              <Address>
                <No />
                <Street />
                <Locality />
                <Region />
                <PostCode />
                <Country />
              </Address>
              <Geo longitude="" latitude="" />
            </Location>
            <Images>
              <img class="thumbnail"/>
              <img class="display"/>
              <img class="detail"/>
              <img class="marker"/>
            </Images>
            <Description/>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail/>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind nodeset="tblContent">
      <bind id="cModuleTitle" nodeset="cContentName" required="false()" type="string"/>
      <bind nodeset="cContentXmlBrief/Content">
        <bind id="cPosition" nodeset="@position" required="true()" type="string"/>
        <bind id="cModuleType" nodeset="@moduleType" required="true()" type="string"/>
        <bind id="cModuleBox" nodeset="@box" required="false()" type="string"/>
        <bind id="cModuleTitle" nodeset="@title" required="false()" type="string"/>
        <bind id="cModuleLink" nodeset="@link" required="false()" type="string"/>
        <bind id="cModuleLinkText" nodeset="@linkText" required="false()" type="string"/>
        <bind id="cLinkType" nodeset="@linkType" required="false()" type="string"/>
        <bind id="nZoom" nodeset="Zoom" required="true()" type="number"/>
        <bind id="nHeight" nodeset="@height" required="true()" type="number"/>
        <bind nodeset="Zoom">
          <bind id="bZoom" nodeset="@allow" required="true()" type="string"/>
          <bind id="bZoomDisableMouseWheel" nodeset="@disableMouseWheel" required="true()" type="string"/>
        </bind>
        <bind id="cControl" nodeset="Control" required="true()" type="string"/>
        <bind id="cView" nodeset="View" required="false()" type="string"/>
        <bind id="cDescription" nodeset="Description" required="false()" type="string"/>
        <bind id="bTypeButtons" nodeset="TypeButtons" required="true()" type="string"/>
        <bind nodeset="Location">
          <bind id="bMarker" nodeset="@marker" required="true()" type="string"/>
          <bind id="cContentVenue" nodeset="Venue" required="false()" type="string"/>
          <bind nodeset="Address">
            <bind id="cContentLocationNo" nodeset="No" required="false()" type="string"/>
            <bind id="cContentLocationStreet" nodeset="Street" required="false()" type="string"/>
            <bind id="cContentLocationTown" nodeset="Locality" required="false()" type="string"/>
            <bind id="cContentLocationRegion" nodeset="Region" required="false()" type="string"/>
            <bind id="cContentLocationPostCode" nodeset="PostCode" required="false()" type="string"/>
          </bind>
          <bind nodeset="Geo">
            <bind id="cContentLocationLong" nodeset="@longitude" required="false()" type="string"/>
            <bind id="cContentLocationLat" nodeset="@latitude" required="false()" type="string"/>
          </bind>
        </bind>
      </bind>
    </bind>
    <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::bind[@nodeset='tblContent/cContentXmlBrief/Content']"/>
    <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::bind[@nodeset='tblContent']"/>
  </model>
  <group ref="EditContent" class="2col">
    <label>Google Map Module</label>
    <group>
      <group ref="Settings" class="leftSettings">
        <!-- These hidden fields and bindings are required for the component-->
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <input bind="cModuleType" class="hidden">
          <label>ModuleType</label>
        </input>
        <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::group[@id='presentation']"/>
        <ewInclude filePath="/ewcommon/xforms/content/module/genericModule.xml" xPath="descendant-or-self::group[@id='publish']"/>
      </group>
    </group>
    <group>
      <group>
        <label>Module Details</label>
        <input bind="cModuleTitle" class="long">
          <label>Title or name</label>
        </input>
      </group>
      <group class="inline">
        <label>Map Controls</label>
        <!--<select1 bind="cControl" appearance="full" class="required vshort">
          <label>Control size</label>
          <item>
            <label>Large</label>
            <value>Large</value>
          </item>
          <item>
            <label>Small</label>
            <value>Small</value>
          </item>
          <item>
            <label>None</label>
            <value>None</value>
          </item>
        </select1>-->
        <select1 bind="cView" appearance="full" class="radio-inline">
          <label>View</label>
          <item>
            <label>Road map</label>
            <value>ROADMAP</value>
          </item>
          <item>
            <label>Satellite map</label>
            <value>SATELLITE</value>
          </item>
          <item>
            <label>Hybrid map</label>
            <value>HYBRID</value>
          </item>
          <item>
            <label>Terrain map</label>
            <value>TERRAIN</value>
          </item>
        </select1>
        <select1 bind="bTypeButtons" appearance="full" class="vshort">
          <label>Map type buttons</label>
          <item>
            <label>On</label>
            <value>true</value>
          </item>
          <item>
            <label>Off</label>
            <value>false</value>
          </item>
        </select1>
        <select1 bind="bZoom" appearance="full" class="vshort">
          <label>Allow user to change zoom</label>
          <item>
            <label>On</label>
            <value>true</value>
          </item>
          <item>
            <label>Off</label>
            <value>false</value>
          </item>
        </select1>
        <select1 bind="bZoomDisableMouseWheel" appearance="full" class="vshort">
          <label>Disable Mousewheel</label>
          <item>
            <label>On</label>
            <value>true</value>
          </item>
          <item>
            <label>Off</label>
            <value>false</value>
          </item>
        </select1>
        <range bind="nZoom" start="1" end="17" step="1">
          <label>Zoom</label>
        </range>
        <range bind="nHeight" start="0" end="1000" step="10">
          <label>Height</label>
        </range>
        <!--<input bind="nLat" class="short">
          <label>Latitude</label>
        </input>
        <input bind="nLong" class="short">
          <label>Longitude</label>
        </input>
        <div>OR</div>-->
        <!--<input bind="cGeoCode" class="short">
          <label>Postcode</label>
        </input>-->
      </group>
      <group>
        <label>Map Locations</label>
        <input bind="cContentVenue" class="short">
          <label>Place name</label>
        </input>
        <group class="inline">
          <input bind="cContentLocationNo" class="vshort keep_empty">
            <label>Name or no. </label>
          </input>
          <input bind="cContentLocationStreet" class="keep_empty">
            <label>Street</label>
          </input>
          <input bind="cContentLocationTown" class="keep_empty">
            <label>Town / city</label>
          </input>
          <input bind="cContentLocationRegion" class="keep_empty">
            <label>County / region</label>
          </input>
          <input bind="cContentLocationPostCode" class="vshort keep_empty">
            <label>Postal code</label>
          </input>
          <submit submission="" ref="" class=" hideRequired getGeocodeButton" icon="fa-map-marker">
            <label>Get Latitude and Longitude</label>
          </submit>
        </group>
        <group class="inline">
          <input bind="cContentLocationLat" class="required">
            <label>Latitude</label>
          </input>
          <input bind="cContentLocationLong" class="required">
            <label>Longitude</label>
          </input>
        </group>
        <select1 bind="bMarker" appearance="full" class="">
          <label>Add a marker for this location to the map</label>
          <item>
            <label>Yes</label>
            <value>true</value>
          </item>
          <item>
            <label>No</label>
            <value>false</value>
          </item>
        </select1>
        <group>
          <label>Info (appears as bubble on marker)</label>
          <textarea bind="cDescription" class="TextArea xhtml" rows="6" cols="70"/>
        </group>
      </group>
      <group>
        <label>Additional Map Locations</label>
        <label>If you want to plot multiple locations on this map, you can add them here</label>
        <relatedContent type="Location" direction="1Way" search="add,find" relationType="related"/>
      </group>
      <group>
        <label>Module Links</label>
        <select1 bind="cLinkType" appearance="full">
          <label>Type of link</label>
          <item>
            <label>Internal (Going to a page on this site)</label>
            <value>internal</value>
            <toggle case="cLinkType_1" event="DOMActivate"/>
          </item>
          <item>
            <label>External (Going to another site)</label>
            <value>external</value>
            <toggle case="cLinkType_2" event="DOMActivate"/>
          </item>
        </select1>
        <switch class="disable">
          <case id="cLinkType_1">
            <select1 bind="cModuleLink" class="siteTree">
              <label>Link to page</label>
            </select1>
          </case>
          <case id="cLinkType_2">
            <input bind="cModuleLink" class="short">
              <label>Link to URL</label>
            </input>
          </case>
        </switch>
        <input bind="cModuleLinkText" class="long">
          <label>Module footer link text</label>
        </input>
      </group>
    </group>
  </group>
  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Google Map</label>
    </submit>
  </group>
</Content>
